package com.zhkjnet.zhyy.service;

import com.zhkjnet.zhyy.dao.MoneyRecordDao;
import com.zhkjnet.zhyy.entity.MoneyRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MoneyRecordService {

    @Autowired
    private MoneyRecordDao recordDao;

    public List<MoneyRecord> findAllByUserId(Long userId, String message, Long page, Integer length) {
        return recordDao.findAllByUserId(userId, message, (page - 1) * length, length);
    }

    public Long countByUserId(Long userId,String message) {
        return recordDao.countByUserId(userId,message);
    }

}
